clc;clear all;
%%load data
file=dir('data');
for ii=3:length(file)
    load(strcat('data\\',file(ii).name));
end
zc=complex(zc_real,zc_imag);
tx=complex(tx_real,tx_imag);
M=length(tx);N=length(zc);
Nfft=2048;
ac=zeros(1,length(tx));p=ac;r=p;
for i=1:length(tx)
    for m=1:Nfft
       ac(i)=ac(i)+tx(mod(i+m-1,M)+1,1)*zc(mod(m-1,N)+1,1)';
       p(i)=p(i)+tx(mod(i+m-1,M)+1,1)*tx(mod(i+m-1,M)+1,1)';
    end
    r(i)=ac(i)/p(i);
end